@echo off net session >nul 2>&1 if %errorLevel% neq 0 ( powershell -Command "Start-Process -FilePath '%~f0' -Verb RunAs" exit /b ) cd /d "%~dp0" powershell -NoExit -NoLogo -ExecutionPolicy Bypass -Command "$Host.UI.RawUI.ForegroundColor='Blue'; Clear-Host; $Host.UI.RawUI.WindowTitle='Administrator: PowerShell'"